<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模糊查询</title>
    <script th:src="@{/js/vue.js}" type="text/javascript"></script>
    <script th:src="@{/js/axios.js}" type="text/javascript"></script>
<<<<<<< HEAD
    <link th:href="@{/css/head.css}" rel="stylesheet" type="text/css"></link>
=======
>>>>>>> a254f66694e58548627c0548f6e222a03570bbfd
    <style>
        body {
            font-size: 12px;
            margin-right: 0px;
            padding-bottom: 10px;
            font-family: Verdana;
            margin: 0;
            padding: 0;
            /* background-color: #EEEEFF; */
        }
<<<<<<< HEAD

=======
        #hd_info {
            background: #F8F8F8;
            height: 28px;
            border-bottom: 1px solid #E5E5E5;
            position: relative;
            margin-left: 0px;
            margin-right: 0px;
            padding-right: 0px;
            padding-bottom: 0px;
            padding-top: 0px;
            margin-top: 0px;
            margin-bottom: 0px;
        }
        #cnts{
            padding: 4px 8px 0 8px;
            margin: auto;
        }
        #login_area {
            margin: 0px 0px 2px 0px;
            padding-top: 2px;
            text-align: right;
            font-size: 12px;
            font-family: Verdana;
            color: #5B5B5B;
            overflow: hidden;
            position: absolute;
            top: 5px;
            right: 10px;
        }
        #login_area a{
            text-decoration: none;
            color: #336699;
        }
>>>>>>> a254f66694e58548627c0548f6e222a03570bbfd
        #header {
            margin-top: 0px;
            height: 102px;
            vertical-align: middle;
            padding-top: 0px;
        }
        #logo {
            position: absolute;
            left: 10px;
            top: 45px;
            z-index: 999;
            color: #009;;
        }
        #main{
            font-size: 12px;
            font-family: Verdana;
            margin-left: 210px;
            padding-right: 0px;
            padding-top: 0px;
            background-color: #FFF;
            border: 1px solid #666;
            margin-right: 5px;
            margin-top: 0px;
        }
        #main h2 {
            margin: 0px 0px 0px 0px;
            background-color: #B6C9E7;
            padding: 3px;
            border-bottom: 1px solid #666;
            font-family: Arial;
            height: 20px;
            font-size: 13px;
        }
        h2 {
            display: block;
            font-size: 1.5em;
            margin-block-start: 0.83em;
            margin-block-end: 0.83em;
            margin-inline-start: 0px;
            margin-inline-end: 0px;
            font-weight: bold;
        }
        #authors{
            font-family: Verdana;
            top: 131px;
            position: absolute;
            width: 200px;
            left: 5px;
            background-color: #FAFAFA;
            border-left: 1px solid #666;
            border-right: 1px solid #666;
            border-bottom: 1px solid #666;
            font-size: 12px;
            margin-top: 0px;
            padding-top: 0px;
            overflow: hidden;
        }
        #authors h2 {
            color: #FFF;
            margin-bottom: 2px;
            margin-top: 0px;
            background-color: #6B86B3;
            border-bottom: 1px solid #666;
            border-top: 1px solid #666;
            padding-top: 3px;
            padding-bottom: 3px;
            font-family: Verdana;
            font-size: 12px;
            text-align: center;
            text-transform: uppercase;
            font-weight: normal;
            width: 200px;
        }
        #authors ul {
            list-style: none;
            margin-bottom: 3px;
            padding-left: 5px;
            padding-right: 5px;
            list-style-type: circle;
            padding-top: 5px;
            margin-top: 0px;
            margin-left: 5px;
            width: 190px;
            word-wrap: break-all;
        }
        ul {
            display: block;
            list-style-type: disc;
            margin-block-start: 1em;
            margin-block-end: 1em;
            margin-inline-start: 0px;
            margin-inline-end: 0px;
            padding-inline-start: 40px;
        }
        #authors li {
            border-bottom: 1px dotted #DDDDDD;
            margin-top: 2px;
            line-height: 20px;
            word-wrap: break-all;
            list-style: none;
        }
        li {
            display: list-item;
            text-align: -webkit-match-parent;
        }
        #authors .NavLink a:link,
        #authors .NavLink a:active, #authors .NavLink a:visited {
            text-decoration: none;
            color: #3B5998;
        }
        a:link, a:active {
            color: #009;
        }
        a:-webkit-any-link {
            color: -webkit-link;
            cursor: pointer;
            text-decoration: underline;
        }
        #main .PagerLink {
            padding-bottom: 0px;
            background-color: #FFFFFF;
            padding: 4px;
            padding-bottom: 0px;
            font-family: Arial;
            font-size: 9pt;
            text-align: right;
            font-weight: normal;
            bottom: 0px;
            margin-bottom: 0px;
            margin-right: 10px;
        }
        #main .post {
            font-family: Arial;
            font-size: 12px;
            line-height: 150%;
            border-bottom: none;
            margin-top: 0px;
            padding-top: 0px;
            margin-right: 0px;
            padding-right: 0px;
        }
        #main h3 {
            font-size: 13px;
            padding-left: 10px;
            margin-left: 10px;
            margin-right: 10px;
            margin-top: 5px;
            background-color: #E5EEF7;
            border-top: 1px solid #666;
            border-bottom: 1px dashed #666;
            padding: 2px;
        }
        h3 {
            display: block;
            font-size: 1.17em;
            margin-block-start: 1em;
            margin-block-end: 1em;
            margin-inline-start: 0px;
            margin-inline-end: 0px;
            font-weight: bold;
        }
        #main h4 {
            font-family: Verdana,Arial;
            font-size: 13px;
            line-height: 150%;
            font-weight: normal;
            padding-left: 10px;
            margin-left: 10px;
            margin-right: 10px;
        }
        h4 {
            display: block;
            margin-block-start: 1.33em;
            margin-block-end: 1.33em;
            margin-inline-start: 0px;
            margin-inline-end: 0px;
            font-weight: bold;
        }

        #main a.CommentLink {
            color: #000;
            text-decoration: none;
        }

    </style>
</head>
<body>
<div id="app">
<<<<<<< HEAD
    <div th:include="~{common/head::head}"></div>
=======
    <div id="hd_info">
        <div id="cnts">
            <div id="login_area">
                  <span>
                      [
                      <a href="/api/public/go2Login">登录</a>
                      .
                      <a href="/api/public/go2AddUser">注册</a>
                      ]
                  </span>
            </div>
        </div>
    </div>
>>>>>>> a254f66694e58548627c0548f6e222a03570bbfd
    <div id="header">
        <div id="logo">
            <h1><i>BlogJava</i></h1>
        </div>
    </div>
    <div id="main">
        <h2>
            搜索结果
        </h2>
        <div class="PagerLink">
<<<<<<< HEAD
            <input type="text" placeholder="请输入关键字按回车查询" @keyup.enter="search()" v-model="blog.title">
        </div>
        <div class="post" >
            <div v-if="blogs==null || blogs.length==0">
                <h4>
                    暂无结果
                </h4>
            </div>
            <div v-if="blogs!=null&&blogs.length>0" v-for="obj in blogs">
                <h3>
                    {{obj.title}}
                </h3>
                <h4 >
                    <p>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        {{obj.msg}}
                        &nbsp;&nbsp;
                        <a href="javascript:void(0)" @click="readContent(obj.id)">阅读全文</a>
                    </p>
                    <p class="postfoot" align="right">
                        发布时间:{{obj.tcreate}}&nbsp;作者:{{obj.author}}&nbsp;
                        <a href="" class="CommentLink">[评论:{{obj.commentnum}}]</a>
                        [阅读:{{obj.readnum}}]&nbsp;
                    </p>
                </h4>
            </div>
=======
            <input type="text" placeholder="请输入关键字" @keyup.enter="search()" v-model="blog.title">
        </div>
        <div class="post" v-for="obj in blogs">
            <h3>
                {{obj.title}}
            </h3>
            <h4 >
                <p>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    {{obj.msg}}
                    &nbsp;&nbsp;
                    <a href="javascript:void(0)" @click="readContent(obj.id)">阅读全文</a>
                </p>
                <p class="postfoot" align="right">
                    发布时间:{{obj.tcreate}}&nbsp;作者:{{obj.author}}&nbsp;
                    <a href="" class="CommentLink">[评论:{{obj.answernum}}]</a>
                    [阅读:{{obj.readnum}}]&nbsp;
                </p>
            </h4>
>>>>>>> a254f66694e58548627c0548f6e222a03570bbfd


        </div>
        <hr>

    </div>
    <div id="authors">
        <h2>
            操作
        </h2>
        <ul class="NavLink">
            <li class="natitle">
                <a href="/api/public/go2Index" >首页</a>
            </li>
        </ul>
    </div>


</div>

</body>
<script>
    new Vue({
        el:'#app',
        data:{
            blogs:[],
            showTitleNum:0,
            blog:{}
        },
        methods:{
            //根据标题模糊查询某篇博客
            search(){
                var that = this
                axios.post("/api/public/findBlogsByTitle",this.blog).then(function (resp) {
                    that.blogs = resp.data.data
                    console.log("blogs==")
                    console.log(that.blogs)
                })

            },
            //跳转到阅读全文页面
            readContent(blogid){
                sessionStorage.setItem("blogid",blogid);
                window.location.href="/api/public/go2ReadBlog/"+blogid;
            },



        },
        mounted:function () {

        }
    })
</script>
</html>